package com.woniu.user.service.Imp;

import com.woniu.common.pojo.Creat;
import com.woniu.user.mapper.CreatMapper;
import com.woniu.user.service.CreatService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CreatServiceImpl implements CreatService {
    @Resource
    private CreatMapper creatMapper;

    @Override
    public void creatUser(Creat creat) {
        creatMapper.addCart(creat.getUser().getId(), creat.getFlower().getFid(), creat.getNum());
    }

    @Override
    public Creat existsInCart(Integer uid, Integer fid) {
        return creatMapper.existsInCart(uid, fid);
    }

    @Override
    public List<Creat> selectCreat(Integer id) {
        return creatMapper.selectCreat(id);
    }

    @Override
    public int selectCount(Integer uid) {
        return creatMapper.selectCount(uid);
    }

    public void delete(Integer[] ids) {
            creatMapper.deletes(ids);
    }


}
